import requests

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36',
    'Referer': 'https://www.bilibili.com'
}
url = 'https://eqwl1q9q.v1d.szbdyd.com:9305/upgcxcode/11/34/577453411/577453411-1-30080.m4s?xyip=183.138.7.247&xyport=9305&xy_usource=upos-sz-mirrorcos.bilivideo.com&xy_mark=rsc-upos-sz-mirrorcos.disp.bilivideo.com&e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1650726102&gen=playurlv2&os=rsc&oi=1001201620&trid=7e346a7a64cc480aa39ff5e0c3656d45u&platform=pc&upsig=af985070d3f2dbc753098a9f0097b975&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&pcdnid=1000007746&mid=435001858&bvc=vod&nettype=0&orderid=0,3&agrr=0&bw=330511&logo=80000000'
audio = 'https://qhng1sgo.v1d.szbdyd.com:9305/upgcxcode/11/34/577453411/577453411-1-30280.m4s?xyip=125.108.2.192&xyport=9305&xy_usource=upos-sz-mirrorhw.bilivideo.com&xy_mark=rsc-upos-sz-mirrorhw.disp.bilivideo.com&e=ig8euxZM2rNcNbdlhoNvNC8BqJIzNbfqXBvEqxTEto8BTrNvN0GvT90W5JZMkX_YN0MvXg8gNEV4NC8xNEV4N03eN0B5tZlqNxTEto8BTrNvNeZVuJ10Kj_g2UB02J0mN0B5tZlqNCNEto8BTrNvNC7MTX502C8f2jmMQJ6mqF2fka1mqx6gqj0eN0B599M=&uipk=5&nbs=1&deadline=1650727981&gen=playurlv2&os=rsc&oi=1001201620&trid=e84a8cad40014e4aa59cbe25aea6bc27u&platform=pc&upsig=85beb0522d8b529a536e34082cdef217&uparams=e,uipk,nbs,deadline,gen,os,oi,trid,platform&pcdnid=1000007885&mid=0&bvc=vod&nettype=0&orderid=0,3&agrr=0&bw=40459&logo=80000000'
content = requests.get(url=audio, headers=headers).content

with open('1.mp3', 'wb') as f:
    f.write(content)
